<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      .container {
        font-size: 10px;
      }

      .box {
        font-size: 20px;
      }

      .text1 {
        font-size: 20px;
      }

      .text2 {
        /* 相对于父元素 */
        font-size: 2em;
      }

      html {
        font-size: 10px;
      }

      .text3 {
        /* 相对于html元素字体大小 */
        font-size: 2rem;
      }

      .text4 {
        /* 将浏览器窗口等分成100份 1vw = 屏幕宽度的1% */
        font-size: 20vw;
      }

      .container1 {
        display: flex;
      }

      /* .box1 {
        width: 187.5px;
        height: 100px;
        background-color: #000;
      } */
      .box1 {
        width: 50vw;
        height: 100px;
        background-color: #000;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="box">
        <span class="text1">这是一段文字</span>
        <span class="text2">这是一段文字</span>
        <span class="text3">这是一段文字</span>
        <span class="text4">这是一段文字</span>
        <span>这是一段文字</span>
      </div>
    </div>

    <div class="container1">
      <div class="box1"></div>
      <div class="box1"></div>
    </div>
  </body>
</html>
